#pragma once
#ifndef GAME_H
#define GAME_H
// Includes
#include <Core.h>
// Managers
#include <EntityManager.h>
#include <MessageHandler.h>
//#include <Animation.h>
#include <AnimationPlayer.h>
#include <ForceRegistry.h>
#include <StateMachine.h>
// Entites
#include "Player.h"
#define ALLNODES 6
#define NEUTRALNODES ALLNODES-3

#include "Node.h"

class Game : public Core
{
private:
	D3DVIEWPORT9 viewport;

	// textures for neutral nodes
	IDirect3DTexture9* nutralNodeAnim[NEUTRALNODES];
	IDirect3DTexture9* securedNodeAnim[NEUTRALNODES];
	IDirect3DTexture9* hackedNodeAnim[NEUTRALNODES];
	IDirect3DTexture9* hackingSecuredNodeAnim[NEUTRALNODES];
	IDirect3DTexture9* secureHackedNodeAnim[NEUTRALNODES];
	IDirect3DTexture9* hackingNeutralNodeAnim[NEUTRALNODES];
	IDirect3DTexture9* securingNeutralNodeAnim[NEUTRALNODES];

	//textures for cursor
	IDirect3DTexture9* playerIdleAnim;
	IDirect3DTexture9* playerCursorAnim;
	IDirect3DTexture9* playerTargetAnim;

	//player base anim
	IDirect3DTexture9* playerBaseIdleAnim;
	IDirect3DTexture9* playerBaseActiveAnim;

	//enemy base anim
	IDirect3DTexture9* enemyBaseIdleAnim;
	IDirect3DTexture9* enemyBaseActiveAnim;

	//finish base anim
	IDirect3DTexture9* finishBaseIdleAnim;
	IDirect3DTexture9* hackingFinishBaseAnim;
	IDirect3DTexture9* hackedFinishBaseAnim;



	// Declare entites
	Player* player;
	Node* node[ALLNODES];
	D3DXVECTOR3 nodePositions[ALLNODES];
	AnimationPlayer* tmp[ALLNODES];
	//adding links between nodes
	std::list<Node*> links[ALLNODES];
	
public:
	// StateMachine used for switching game states.
	StateMachine<Game> stateMachine;


	// Methods
	Game(HINSTANCE hInstance, int nShowCmd);
	virtual ~Game();
	void initialise();
	void loadContent();
	void unloadContent();
	void update(float frameTime);
	void render();
};

#endif // GAME_H